<template>
    <div>
      <div class="tab_warp">
        <div @click="changeTab('Message')">
          <img class="tabimg" v-show="componentId!='Message'"  src="../../assets/ic_message_default.png" alt="">
          <img class="tabimg" v-show="componentId=='Message'" src="../../assets/ic_message.png" alt="">
          <div v-show="componentId!='Message'"  >消息</div>
          <div v-show="componentId=='Message'"   style="color:#E83263;">消息</div>
        </div>
        <div @click="changeTab('MyFriend')">
          <img class="tabimg"  v-show="componentId!='MyFriend'"  style="width:24px" src="../../assets/ic_myfriend_default.png" alt="">
          <img class="tabimg" v-show="componentId=='MyFriend'"  style="width:24px" src="../../assets/ic_myfriend.png" alt="">
          <div v-show="componentId=='MyFriend'"   style="color:#E83263;">好友</div>
          <div v-show="componentId!='MyFriend'"   >好友</div>
        </div>
        <div @click="changeTab('My')">
          <img class="tabimg"  v-show="componentId!='My'"  style="width:20px" src="../../assets/ic_my_default.png" alt="">
          <img class="tabimg" v-show="componentId=='My'"  style="width:20px" src="../../assets/ic_my.png" alt="">
          <div v-show="componentId=='My'"   style="color:#E83263;">我的</div>
          <div v-show="componentId!='My'"   >我的</div>
        </div>
      </div>
      <!-- <component :is="componentId" ></component> -->
    </div>
</template>
<script>
// import { Tabbar, TabbarItem } from 'vant';
export default {
  name: 'tab',
  props:{
    selected:String,
  },
  data () {
    return {
      componentId:this.selected
    }
  },
  methods:{
    changeTab(e){
      this.$router.push({ name: e, params: {} });
    }
  },
  components:{
    // Tabbar,
    // TabbarItem,
  }
}
</script>
<style scoped>
  .tab_warp{
    display: flex;
    justify-content: space-around;
    font-size:12px;  
    background: #fff;
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 50px;
    align-items: center;
    color: #999;
  }
  .tabimg{
    width: 23px;
    height: 23px;
    margin: 0 auto;
    margin-top: 2px;
  }
</style>
